<?php
session_start();
?>
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-Transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Rotaract DLSU</title>
<meta http-equiv="Content-Type" content="text/html"/>
<meta name="robots" content="index,follow"/>
<meta name="distribution" content="global"/>
<meta name="description" content=""/>
<meta name="keywords" content=""/>
<link href="css/style.css" rel="stylesheet" type="text/css" media="screen" />
<link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css"/>
<link rel="stylesheet" href="css/demos.css"/>
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jquery.ui.core.js"></script>
<script src="js/jquery.ui.widget.js"></script>
<script src="js/jquery.ui.datepicker.js"></script>

	<script>
	$(function() {
		$( "#datepicker" ).datepicker({
			changeMonth: true,
			changeYear: true,
                        dateFormat: 'yy-mm-dd'
		});
	});
	</script>

</head>
<body>
<div id="container2">
  <div id="main2">
    <table width="100%" cellspacing="0" cellpadding="0">
      <tr>
        <td class="main_nav">
            <div id="main_text2"> 
                <center>
                <br/>
                <br/>
                <h2>Announcements</h2>
               <br/>
                    <?
                    include 'DBLibrary/config.php';
                    include 'DBLibrary/openDB.php';

                        mysql_select_db("rotaract");
                    $query = "SELECT * FROM announcement order by date asc";
                        $result = mysql_query($query)or die(mysql_error());
                        if(mysql_num_rows($result) == 0){
                            ?>
                            <h3>No announcements available.</h3>
                            <?
                        }
                        else{
                        while($row = mysql_fetch_array($result)){
                            $id = $row['id'];
                            $title = $row['title'];
                            $date = $row['date'];
                            $desc = $row['desc'];
                            $img = $row['imageurl'];
                            if($img != ''){?>
                                
                                 <br/>  
                                 <center><h3><?=$title?></h3></center>
                                 <br/> 
                                 
                                <center> <img src='<?=$img?>' height="150" style="width:150px;
border:2px solid black;" onmouseover="this.style.width='400px', this.style.height='400px'" onmouseout="this.style.width='150px', this.style.height='150px'" alt="" title="" /></center>
                                     
                                <br/>
                                <center><?=$date?></center>
                                <br/>
                                <center><?=$desc?></center>
                                <br/>
                                <hr size="2" align="center" width="75%"/>
                                <?
                            }
                            else{?>
                                 
                                 <br/>  
                                 <center><h3><?=$title?></h3></center>
                                 <br/> 
                                 <br/>
                                 <center><?=$date?></center>
                                 <br/>
                                 <center><?=$desc?></center>
                                 <br/>
                                 <hr size="2" align="center" width="75%" noshade/>
                                 
<?
                            }

                             }
                        }
                ?>
                </center>
                </div>
        </td>
      </tr>
        </table>
        </div>
          </div>
</body>
</html>

